//
//  ChatGroupTableViewCell.m
//  BGM
//
//  Created by 我要变好看 on 2018/12/21.
//  Copyright © 2018 com.alirtc.demo. All rights reserved.
//

#import "ChatGroupTableViewCell.h"

#import "Common.h"


@interface ChatGroupTableViewCell ()

@property (nonatomic, strong)UILabel *nameLabel;
@property (nonatomic, strong)UIView *HeadView;
@property (nonatomic, strong)UIButton *seleBtn;


@end


@implementation ChatGroupTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self !=nil) {
        self.backgroundColor = bgmColor(244, 244, 244);
        UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(15, 10, SCREENW-30, 78)];
        bgView.layer.cornerRadius = 8;
        bgView.layer.masksToBounds = YES;
        bgView.backgroundColor = [UIColor whiteColor];
        [self addSubview:bgView];
        
        self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(15, 10, SCREENW-60, 30)];
        self.nameLabel.textColor = bgmmainColor;
        [bgView addSubview:self.nameLabel];
        
        self.HeadView = [[UILabel alloc]initWithFrame:CGRectMake(15, 45, SCREENW-60, 30)];
        [bgView addSubview:self.HeadView];
        
        
        self.seleBtn = [[UIButton alloc]initWithFrame:CGRectMake(bgView.frame.size.width-50, 15, 30, 30)];
        [self.seleBtn setImage:[UIImage imageNamed:@"titleNormal"] forState:UIControlStateNormal];
        [self.seleBtn setImage:[UIImage imageNamed:@"tittleSele"] forState:UIControlStateSelected];
        [self.seleBtn addTarget:self action:@selector(clickBtn:) forControlEvents:UIControlEventTouchUpInside];
        [bgView addSubview:self.seleBtn];

    }
    return self;
}

- (void)setGroupView:(NSDictionary *)dic{
    NSLog(@"asdfsadfsfdas");
    
}
- (void)clickBtn:(UIButton *)btn{
    btn.selected = !btn.selected;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
